{% extends "base.html" %}

{% block title %}
 {{ object.title }}
{% endblock %}

{% block content %}
     <h1>
     {{ module.title }}
     </h1>

     <div class="contents">
         <h3>模块</h3>
         <ul id="modules">
             {% for m in object.modules.all %}
             <li data-id="{{ m.id }}" {% if m == module %} class="selected"{% endif %}>
                 <a href="{% url "student_course_detail_module" object.id m.id %}">
                     <span>
                        Module <span class="order">{{ m.order|add:1 }}</span>
                     </span>

                     <br>
                     {{ m.title }}
                 </a>
             </li>
             {% empty %}
             <li>还没有模块。</li>
             {% endfor %}
         </ul>
     </div>

     <div class="module">
         {% for content in module.contents.all %}
             {% with item=content.item %}
                 <h2>{{ item.title }}</h2>
                 {{ item.render }}
             {% endwith %}
         {% endfor %}
     </div>
{% endblock %}